Skip to content

feat/filedata metadata support #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 28, 2024
Merged

Conversation

rbiseck3
Copy link
Collaborator

@rbiseck3 rbiseck3 commented Oct 25, 2024

Description

To support providing additional information as part of the plugin invocation without it being directly tied to the input/output model, a metadata base model is dynamically passed in if the wrapped method is expecting it.

New models added:

class NewRecord(BaseModel):
    file_data: FileData
    contents: Any


class FileDataMeta(BaseModel):
    terminate_current: bool = False
    new_records: list[NewRecord] = Field(default_factory=list)

@rbiseck3 rbiseck3 requested a review from vangheem October 25, 2024 15:24
usage=usage,
filedata_meta=filedata_meta_model.model_validate(filedata_meta.model_dump()),
status_code=status.HTTP_200_OK,
output=output,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought FileData is returned in the output. If so, why does filedata_metadata have a new_records field for FileData?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In most scenarios, the output of a generic plugin wouldn't include the FileData, just some input/output content. This allows for communication to take place that doesn't follow into that pattern, such as the plugin generating new FileData content.

@rbiseck3 rbiseck3 merged commit f89d2a6 into main Oct 28, 2024
7 checks passed
@rbiseck3 rbiseck3 deleted the roman/filedata-metadata-support branch October 28, 2024 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants